@extends('admin.main')
@section('content')
    <div class="daohang">
        <ul>
            <li>
                <button type="button" class="am-btn am-btn-default am-radius am-btn-xs"> 短信模板管理</button>
            </li>
        </ul>
    </div>
    <div class="admin-biaogelist">

        <div class="listbiaoti am-cf">
            <ul class="am-icon-flag on"> 短信模板列表</ul>
            {{--<dl>--}}
                {{--<button type="button" class="am-btn am-btn-danger am-round am-btn-xs am-icon-plus"--}}
                        {{--onclick="window.location.href='{{urlAdmin('depart','getAdd')}}'"> 添加科室--}}
                {{--</button>--}}
            {{--</dl>--}}
            <!--这里打开的是新页面-->
        </div>
        <form class="am-form am-g">
            <table width="100%" class="am-table am-table-bordered am-table-radius am-table-striped am-table-hover">
                <thead>
                <tr class="am-success">
                    <th width="10%">模板名称</th>
                    <th width="10%">模板ID</th>
                    <th width="40%">模板内容</th>
                    <th width="2%" class="table-set">操作</th>
                </tr>
                </thead>
                <tbody>
                @if(!empty($rows))
                    @foreach($rows as $v)
                        <tr>
                            <td>{{$v['name']}}</td>
                            <td>{{$v['tmpl_id']}}</td>
                            <td>{{$v['tmpl_content']}}</td>
                            <td>
                                <div class="am-btn-toolbar">
                                    <div class="am-btn-group am-btn-group-xs">
                                        <a href="{{urlAdmin('smsTmpl','getEdit',['id'=>$v['id']],2)}}" class="am-btn am-btn-default am-btn-xs am-text-secondary am-round">
                                            <span class="am-icon-pencil-square-o"></span>
                                        </a>
                                    </div>
                                </div>
                            </td>
                        </tr>
                    @endforeach
                @else
                    <tr>
                        <td colspan="5" style="text-align: center"><span>暂无数据~</span></td>
                    </tr>
                @endif
                </tbody>
            </table>
            @if(!empty($rows['pageNoList']))
                <ul class="am-pagination am-fr">
                    <li @if(!$rows['prev_page_url']) class="am-disabled" @endif ><a
                                href="{{$rows['prev_page_url']}}">«</a></li>
                    @foreach($res['pageNoList'] as $v)
                        <li @if($rows['current_page'] == $v) class="am-active" @endif><a
                                    href="{{urlAdmin('depart','getIndex',['page'=>$v],2)}}">{{$v}}</a></li>
                    @endforeach
                    <li @if(!$rows['next_page_url']) class="am-disabled" @endif><a
                                href="{{$rows['next_page_url']}}">»</a></li>
                </ul>
            @endif
            <hr/>
        </form>
        @include('admin.footer')
    </div>
        @section('script')
            <script>
                var message = "{{Session::get('message')}}";
                $(window).ready(function () {
                    if (message) {
                        layer.msg(message, {
                            time: 3000 //2秒关闭（如果不配置，默认是3秒）
                        });
                    }
                });
            </script>
        @endsection
@endsection